Skip to content

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Jul 7, 2024

changelog: [manual_unwrap_or]: fix false positive of if let Option<T>

Closes #13018

@rustbot
Copy link
Collaborator

rustbot commented Jul 7, 2024

r? @dswij

rustbot has assigned @dswij.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 7, 2024
@tesuji tesuji force-pushed the fix-map-unwrap-or-13018 branch from 74c40db to 31db1d5 Compare July 7, 2024 03:49
Copy link
Member

@dswij dswij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tesuji Do you want to look into the FIXME in this PR?

@tesuji
Copy link
Contributor Author

tesuji commented Jul 7, 2024

I kinda think that FIXME about using dereferecing module is more like a question rather than an improvement.
And it's non-actionable because expr_adjustments(then_expr) is empty. Meaning that there are no magic defers or re-borrowing to make then_expr's type equals to let_expr.unwrap()'s type.
I'll remove the FIXME.

@tesuji tesuji force-pushed the fix-map-unwrap-or-13018 branch 2 times, most recently from 042cef1 to b19513c Compare July 7, 2024 13:38
with `Option::unwrap_or(self, T) -> T`.
@tesuji tesuji force-pushed the fix-map-unwrap-or-13018 branch from b19513c to c46c1f6 Compare July 7, 2024 13:42
@tesuji
Copy link
Contributor Author

tesuji commented Jul 13, 2024

Also cc rust-lang/rust#127629. In the future, I may try to suggest map_or instead unwrap_or.

@dswij
Copy link
Member

dswij commented Jul 13, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jul 13, 2024

📌 Commit c46c1f6 has been approved by dswij

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 13, 2024

⌛ Testing commit c46c1f6 with merge e7d17e6...

@bors
Copy link
Contributor

bors commented Jul 13, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: dswij
Pushing e7d17e6 to master...

@bors bors merged commit e7d17e6 into rust-lang:master Jul 13, 2024
1 check passed
@tesuji tesuji deleted the fix-map-unwrap-or-13018 branch July 13, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly clippy: manual_unwrap_or false positive
4 participants